package cn.devices.service.impl;

import cn.devices.entity.TbEvent;
import cn.devices.mapper.TbEventMapper;
import cn.devices.service.TbEventService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.List;

/**
 * <p>
 * 告警事件表 服务实现类
 * </p>
 *
 * @author 秋水浮萍
 * @since 2021-02-07
 */
@Service
public class TbEventServiceImpl  implements TbEventService {

    @Autowired
    private TbEventMapper mapper;
    @Override
    public PageInfo<TbEvent> eventList(int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex, pageSize);
        List<TbEvent> list = mapper.eventList();


        return new PageInfo<>(list);
    }

    @Override
    public int eventAdd(TbEvent event) {
        return mapper.eventAdd(event);
    }
}
